package com.cloud.shopping.search.service.impl;

import com.cloud.shopping.search.mapper.SeckillGoodsSearchMapper;
import com.cloud.shopping.search.model.SeckillGoodsEs;
import com.cloud.shopping.search.service.SeckillGoodsSearchService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author John.zhang
 * @version Id: SeckillGoodsSearchServiceImpl, v 1.0 2021/1/8 11:29 ZhiYong Exp $
 */
@Service
public class SeckillGoodsSearchServiceImpl implements SeckillGoodsSearchService {

    @Resource
    private SeckillGoodsSearchMapper seckillGoodsSearchMapper;

    /**
     * 秒杀商品导入索引库
     * @param seckillGoodsEs seckillGoodsEs
     */
    @Override
    public void add(SeckillGoodsEs seckillGoodsEs) {
        seckillGoodsSearchMapper.save(seckillGoodsEs);
    }

    @Override
    public List<SeckillGoodsEs> search(String acid) {
        return seckillGoodsSearchMapper.searchByActivityId(acid);
    }

}
